package com.hospital.service.system.model.param;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hospital.service.system.entity.SysConfiguration;
import com.hospital.service.system.entity.help.SysConfigurationHelp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import enhance.plus.util.MybatisPlusUtil;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 系统配置表 新增参数
 *
 * @author AnKh
 * @created 2020-10-11 20:27:11
 */
@Data
@ToString
@Accessors(chain = true)
@ApiModel(value="SysConfiguration[系统配置表]入参")
public class SysConfigurationQueryForOneRowParam implements Serializable{

    /**
    * ID
    */
    @ApiModelProperty(value = "ID", required = false , example = "")
    private String id;

    /**
     * 把非 null 的值 转换成一个 查询条件
     * @return
     */
    public QueryWrapper<SysConfiguration> convertParamToQueryWapper(){
        QueryWrapper<SysConfiguration> query = SysConfigurationHelp.createQuery();
        Map<String, Object> result =  MybatisPlusUtil.convertParamToMap(this, SysConfiguration.class);
        query.allEq(result);
        return query;
    }
}
